﻿using Appliaction.Dto.Base_Manage;
using Appliaction.IAppServices.Base_Manage;
using AutoMapper;
using Domain.Entitys.Base_Manage;
using Domain.IRepositorys.Base_Manage;
using System;
using System.Collections;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;

namespace Appliaction.AppServices.Base_Manage
{
    public class DictdataService : IDictdataService
    {
        private readonly IDictdataRepository dictdataRepository;
        private readonly IMapper mapper;

        public DictdataService(IDictdataRepository dictdataRepository, IMapper mapper)
        {
            this.dictdataRepository = dictdataRepository;
            this.mapper = mapper;
        }
        /// <summary>
        /// 查询总条数
        /// </summary>
        /// <param name="Dict_type"></param>
        /// <param name="Dict_label"></param>
        /// <param name="Status"></param>
        /// <returns></returns>
        /// <exception cref="NotImplementedException"></exception>
        public int Getsys_Dict_DatasCount(string Dict_type, string Dict_label, char Status)
        {
            return dictdataRepository.Getsys_Dict_DatasCount(Dict_type, Dict_label, Status);
        }
        /// <summary>
        /// 分页查询、条件查询
        /// </summary>
        /// <param name="Dict_type"></param>
        /// <param name="Dict_label"></param>
        /// <param name="Status"></param>
        /// <param name="currentPage"></param>
        /// <param name="pageSize"></param>
        /// <returns></returns>
        /// <exception cref="NotImplementedException"></exception>
        public List<Sys_Dict_Data> Getsys_Dict_DatasWhere(string Dict_type, string Dict_label, char Status, int currentPage, int pageSize)
        {
            return dictdataRepository.Getsys_Dict_DatasWhere(Dict_type, Dict_label, Status, currentPage, pageSize);
        }
        /// <summary>
        /// 添加
        /// </summary>
        /// <param name="AddDto"></param>
        /// <returns></returns>
        /// <exception cref="NotImplementedException"></exception>
        public Task<int> Postsys_Dict_DatasAdd(DictdataAddDto AddDto)
        {
            Sys_Dict_Data sys_Dict_Data = mapper.Map<Sys_Dict_Data>(AddDto);
            return dictdataRepository.Postsys_Dict_DatasAdd(sys_Dict_Data);
        }
        /// <summary>
        /// 删除
        /// </summary>
        /// <param name="DeleteDto"></param>
        /// <returns></returns>
        /// <exception cref="NotImplementedException"></exception>
        public Task<int> Putsys_Dict_DatasDelete(DictdataDeleteDto DeleteDto)
        {
            Sys_Dict_Data sys_Dict_Data = mapper.Map<Sys_Dict_Data>(DeleteDto);
            return dictdataRepository.Putsys_Dict_DatasDelete(sys_Dict_Data);
        }
        /// <summary>
        /// 修改
        /// </summary>
        /// <param name="UpdateDto"></param>
        /// <returns></returns>
        /// <exception cref="NotImplementedException"></exception>
        public Task<int> Putsys_Dict_DatasUpdate(DictdataUpdateDto UpdateDto)
        {
            Sys_Dict_Data sys_Dict_Data = mapper.Map<Sys_Dict_Data>(UpdateDto);
            return dictdataRepository.Putsys_Dict_DatasUpdate(sys_Dict_Data);
        }
    }
}
